< previous page page_469 next page >

Page 469
If a new version of Visual Basic comes out that breaks the custom control, you have to wait for the vendor to upgrade it before you can use the new version of Visual Basic.
Additional Functions in Visual Basic
The Visual Basic language has so many functions that its impractical to cover them all here. However, the following sections cover a few that you should be aware of. First, lets look at the Format*() functions that are introduced in Visual Basic 6.
FormatCurrency()
FormatCurrency() is very similar to the Format() function using the Currency named format. However, you can do a lot more with the FormatCurrency() function than you can with the Format() function.
Heres the syntax for FormatCurrency():
9f31265bb40b592b1929e18a47ab28e5.gif
FormatCurrency(Expression [,NumDigitsAfterDecimal
               [,IncludeLeadingDigit
               [,UseParensForNegativeNumbers
               [,GroupDigits]]]])
Heres some sample output:
9f31265bb40b592b1929e18a47ab28e5.gif
FormatCurrency(100) = $100.00
FormatCurrency(100,4) = $100.0000
FormatCurrency(.1,-1,vbFalse) = $.10
FormatCurrency(.1,-1,vbFalse) = $0.10
FormatCurrency(-100,-1, , vbFalse) = -$100.00
FormatCurrency(-100,-1, , vbUseDefault) = ($100.00)
FormatCurrency(1,100,-1, , ,vbFalse) = $1100.00
FormatCurrency(1,100,-1, , , vbUseDefault) = $1,100.00
The first parameter is the value you want to use for the currency value. The second parameter is the number of decimal places to use. You can pass -1 to use the default, as specified in your windows regional settings. The third parameter can be set to one of the tri-state values (vbFalse, vbTrue, or vbUseDefault) to specify the use a leading zero in front of a fractional value. If you specify vbFalse, a leading zero is not used; if you specify vbTrue, a leading zero is always used. Finally, if you specify vbUseDefault, the value specified in the regional settings of your

 
< previous page page_469 next page >

If you like this book, buy it!